#include<stdio.h>
#include<stdlib.h>
int maxScore(char* s) {
    int sz = strlen(s) - 1;
    int* a = (int*)malloc(sizeof(int) * sz);
    int tmp1, tmp2, i = 0;
    while (i < sz) {
        tmp1 = 0;
        tmp2 = 0;
        int index1 = i, index2 = i + 1;
        while (index1 >= 0) {
            if (s[index1] == '0') {
                tmp1++;
            }
            index1--;
        }
        while (index2 <= sz) {
            if (s[index2] == '1') {
                tmp2++;
            }
            index2++;
        }
        a[i] = tmp1 + tmp2;
        i++;
    }
    int max = a[0];
    for(i = 1; i < sz; i++){
        if(a[i] > max){
            max = a[i];
        }
    }
    return max ;
}
int main(){
    char* s = "011101\0";
    printf("%d", maxScore(s));
    return 0;
}